﻿//===================================================================
// 西交通开发框架-XCI.Parent 2019 版权所有     
//===================================================================
using System;
using System.ComponentModel.DataAnnotations;
using XCI.Core;

namespace XCI.Sys.Model
{
    /// <summary>
    /// 系统历史日志
    /// </summary>
    [ApiModel(Caption = "系统历史日志")]
    public class SysHistoryLog
    {
        /// <summary>
        /// 历史日志主键
        /// </summary>
        [Display(Name ="历史日志主键")]
        [ApiModelProperty(PrimaryKey = true)]
        public string Id { get; set; }

        /// <summary>
        /// 操作类型 [1-新增, 2-修改, 3-删除]
        /// </summary>
        [Display(Name ="操作类型")]
        public int Category { get; set; }

        /// <summary>
        /// 操作类型名称
        /// </summary>
        [Display(Name ="操作类型名称")]
        public string CategoryName { get; set; }

        /// <summary>
        /// 表名
        /// </summary>
        [Display(Name ="表名")]
        [Required(ErrorMessage = "请输入表名")]
        [StringLength(100, ErrorMessage = "表名不能超过100个字符")]
        public string TableName { get; set; }

        /// <summary>
        /// 主键
        /// </summary>
        [Display(Name ="主键")]
        [Required(ErrorMessage = "请输入主键")]
        [StringLength(100, ErrorMessage = "主键不能超过100个字符")]
        public string PrimaryKey { get; set; }

        /// <summary>
        /// 操作前数据
        /// </summary>
        [Display(Name ="操作前数据")]
        public string BeforeData { get; set; }

        /// <summary>
        /// 操作后数据
        /// </summary>
        [Display(Name ="操作后数据")]
        public string AfterData { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        [Display(Name ="消息")]
        [StringLength(1000, ErrorMessage = "消息不能超过1000个字符")]
        public string Diff { get; set; }

        /// <summary>
        /// 操作人主键
        /// </summary>
        [Display(Name ="操作人主键")]
        public string OperateUserId { get; set; }

        /// <summary>
        /// 操作人姓名
        /// </summary>
        [Display(Name ="操作人姓名")]
        [StringLength(100, ErrorMessage = "操作人姓名不能超过100个字符")]
        public string OperateUserName { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        [Display(Name ="操作时间")]
        public DateTime? OperateDateTime { get; set; }

        /// <summary>
        /// 复制对象
        /// </summary>
        public SysHistoryLog Clone()
        {
            return (SysHistoryLog)MemberwiseClone();
        }
    }
}
